package cn.afactory.tygz.model;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.Serializable;

/**
 * Created by xi on 15/10/12.
 */
public class MoneyRecord extends MoneyShop implements Serializable {


    public int state;

    /**
     * 反序列化函数，用于从json节点对象反序列化本类型实例
     */
    public static MoneyRecord deserialize(JSONObject json) throws JSONException {
        if (json != null && json != JSONObject.NULL && json.length() > 0) {
            MoneyRecord result = new MoneyRecord();

            result.id = json.getInt("id");


            result.name = json.getString("name");
            result.des = json.getString("des");
            result.money = json.getInt("money");
            //result.stock = json.getString("stock");
            result.pic = json.getString("pic");
            result.state = json.getInt("state");

            return result;
        }
        return null;
    }

}
